<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>simple</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
    名: <input type="text" ng-model="firstName"><br>
    姓: <input type="text" ng-model="lastName"><br>
    <br>
    姓名: {{firstName + " " + lastName}}
    <button ng-click="myClick()">提交</button>
</div>
<script src="//cdn.bootcss.com/angular.js/1.5.8/angular.min.js"></script>
<script>
    var app = angular.module('myApp', []);
    app.controller('myCtrl', function ($scope) {
        $scope.firstName = "王";
        $scope.lastName = "鹏飞";
        $scope.myClick = function () {
            alert($scope.firstName + " " + $scope.lastName);
            $scope.firstName = '123';
        }
    });
</script>
</body>
</html>